<template>
    <div class="comeback">
        <div @click="comeback">
            <img src="../assets/other/goback.png" alt="">
        </div>
    </div>
</template>
<script>
export default {
    data () {
        return {
            name: this.getName,
            URL: this.getURL
        }
    },
    props: {
        getName: String,
        getURL: String
    },
    methods: {
        comeback () {
            let vm = this
            if (vm.URL) {
                vm.$router.replace({ path: vm.URL })
            } else {
                vm.$router.back(-1)
            }
        },
    }
}
</script>
<style scoped>
.comeback{
    position: absolute;
    top: 0;
    left: 0;
    z-index: 5;
    padding: 2%;
}
.comeback div{
    width: 2rem;
    height: 2rem;
    border-radius: 1rem;
    background-color: #BEBEC0;
    line-height: 2.3rem;
}
.comeback img{
    height: 1rem;
}
</style>